home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr10 / inter35c.zip / WINHELP.ZIP / TOC2RTF.AWK < prev    next >
Text File  |  1993-02-08  |  1KB  |  47 lines

  1.  
  2.  
  3. BEGIN{
  4.   printf("{\\rtf\n")
  5.   printf("{\\fonttbl\n")
  6.   printf("\\f0\\froman Times New Roman;\n")
  7.   printf("\\f1\\fdecor Courier New;\n")
  8.   printf("\\f3\\fswiss Arial;\n")
  9. #  printf("\\f4\\fnil Monospaced;}\n")
  10.   printf("\\f4\\fmodern Terminal;}\n")
  11.   printf("\\deff3 \n")
  12.   printf("${\\footnote MAIN INDEX }\n")
  13.   printf("K{\\footnote MAIN INDEX }\n")
  14.   printf("#{\\footnote main_index }\n\\f3")
  15.  
  16. }
  17. {
  18. line = $0
  19.  
  20. if ($1 ~ /.freeze/) { next; };
  21.  
  22. if ($1 ~ /\\i\\p\\aUp/) { next };
  23.  
  24. if ($1 ~ /--/) { next };
  25.  
  26. if ($1 ~ /───/) { next };
  27.  
  28. if ($1 ~ /.context/) { next };
  29.  
  30. if ($1 ~ /.topic/) { next };
  31.  
  32. if (($0 ~ /\\b/) && ($0 ~ /\\p/)) { sub("\\\\b", "{\\b ", line); sub("\\\p", " }", line); };
  33.  
  34. if ($0 ~ /Spinellis/) { print "\par Based on:  " line "\n\par Winhelp version (c) 1992, 1993 Raimo Koski\n"; next}
  35.  
  36. gsub("\\\\a\\\i...", "{\\uldb ", line);
  37. sub("\\\\v",    " }{\\v _"      , line);
  38. sub("\\\\v\\\i...",    "Z}"      , line);
  39. gsub("@IL", "_IL", line);
  40. gsub("\t ", "\\tab ", line);
  41. gsub("\t", "\\tab ", line);
  42. print line "\par "
  43. }
  44. END {
  45.   printf("{\\plain \\page}\n}\n")
  46. }
  47.